#ifndef __MCARCVISUAL_H_
#define __MCARCVISUAL_H_

#include <MCArc2D.h>
#include <MCGraphicsItem.h>

class MCArcVisual : public MCGraphicsItem 
{
public:

    MCArcVisual(ICanvas *presenter, const MCArc2D &arc);

    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
    QPainterPath shape() const override;
    bool contains(const QPointF &point) const override;

    void setGripAt(IGripPoint *grip, const MCPoint2D &pos) override;
    void resetGrips() override;

    MCArc2D arc() const;
    void update(const MCPoint2D &center, double radius, double startAngle, double endAngle);
    void update(const MCArc2D &arc);

protected:

    MCArc2D transformed() const;
    void initGrips();

private:

    MCArc2D _arcModel;

};

#endif // !__MCARCVISUAL_H_
